import { reqTrackAll } from "@/api";
const state = {
  trackList: [],
};
const mutations = {
  GETTRACKALL(state, data) {
    // state.newTrackList = data || [];
    state.trackList = data || [];
  },
};

const actions = {
  // 获取歌单
  async getTrackAll({ commit }, params) {
    const result = await reqTrackAll(params);
    console.log(result);
    if (result.code == 200) {
      // this.newTrackList = result.songs || [];
      commit("GETTRACKALL", result.songs);
    } else {
      alert("获取榜单失败");
    }
  },
  // 
};

const getters = {};

export default {
  state,
  mutations,
  actions,
  getters,
};
